﻿@model IEnumerable<Classified.Domain.Entities.Location>
@{
    var https = "http://";
    // var domain = ".krbclassified.com";
    var domainName = System.Configuration.ConfigurationManager.AppSettings["domainName"];
    var domain = "." + domainName + ".com";
}

<div class="clearfix">
    <label>
        Select Entire Country</label>
    <div class="input chzn-select">
        @Html.DropDownList("CountryList")</div>
</div>
<ul class="nav nav-list">
    @foreach (var item in Model.Where(x => x.ParentId == 0))
    {
        <li style="font-weight: normal; width: 170px;"><a href="http://@item.UrlName@domain" class="@item.Name.ToLower()" >@item.Name</a></li>
        <li class="divider"></li>
        <ul class="nav nav-pills">
            @foreach (var i in Model.Where(x => x.ParentId == item.Id))
            {
                    <li style="font-weight: normal; width: 170px;"><a href="http://@i.UrlName@domain" class="@i.Name.ToLower()" >@i.Name</a></li>
        
            }
           <div class="clear"></div>
        </ul>
       
       
    }
    @if (ViewBag.LocationName != "")
    {
        <script type="text/javascript">
            $(".@ViewBag.LocationName").addClass("nav-header");
           
        </script>
    }
</ul>
<script type="text/javascript">
    $(document).ready(function () {

        $(".chzn-select select").chosen();
        $(".chzn-select-deselect").chosen({ allow_single_deselect: false });

        $("#CountryList").change(function () {
            i = $("#CountryList option:selected").text();


            var url = 'http://' + i + '@domain';

            window.location.href = url;

        });

    });
        
</script>
